package com.ganbo.pattern.singleton;

/**
 * 懒汉式单利模式
 *
 * @Author: ganbo
 * @Date: 2020/6/8 20:44
 */
public class LazySingleton {

    private static LazySingleton instance;

    private LazySingleton() {
    }

    public static synchronized LazySingleton getInstance() {
        if (instance == null) {
            instance = new LazySingleton();
        }
        return instance;
    }
}
